use "FL10g_VoterValidation.dta", clear
hist yhat_10 if responded_to_survey == 1hist yhat_10 if g10_voted == 1
xtile yhat = yhat_10, nquantiles(100)bys yhat: egen mean_prob = mean(yhat_10)bys yhat: egen mean_turnout = mean(g10_voted)gen difference = abs(mean_prob - mean_turnout)bys yhat: gen N=_n==1egen wea = total(difference) if N==1replace wea = wea / 100sort weabrowse wea
